﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace xiaolanshu
{
    public partial class 护肤 : Form
    {
        public SqlConnection conn;
        public 护肤()
        {
            InitializeComponent();
            //string cstr = @"server=.\SqlExpress;database=小兰书;integrated security=SSPI";
            //conn= new SqlConnection(cstr);
            conn = SQLTools.conn;
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=435";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show( "商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString()); 
            }
            rd.Close();
            conn.Close();
        }

        private void toolTip1_Popup(object sender, PopupEventArgs e)
        {
           
        }

        private void 护肤_Load(object sender, EventArgs e)
        {
            toolTip1.ShowAlways = true;
            
            toolTip1.SetToolTip(this.pictureBox1, "商品名称：兰蔻清滢保湿柔肤水\n价格：435元\n品类：柔肤水\n适用肤质：干皮\n功效：干皮救星，强补水，长锁水，快吸收\n产地：法国\n净含量：400ml\n保质期：36个月");
            toolTip2.SetToolTip(this.pictureBox2, "商品名称：兰蔻菁纯臻颜玫瑰精萃水\n价格：880元\n品类：精华水\n适用肤质：任何肤质\n功效：长效润养，饱满焕亮，修护抗老\n产地：法国\n净含量：150ml\n保质期：36个月");
            toolTip3.SetToolTip(this.pictureBox3, "商品名称：兰蔻净澈焕肤精华水\n价格：790元\n品类：精华水\n适用肤质：油皮\n功效：油皮挚爱，高能焕肤，温和抛光\n产地：法国\n净含量：150ml\n保质期：36个月");
            toolTip4.SetToolTip(this.pictureBox4, "商品名称：兰蔻小黑瓶精华\n价格：1080元\n品类：精华\n适用肤质：任何肤质\n功效：快修护，强维稳\n产地：法国\n净含量：50ml\n保质期：36个月");
            toolTip5.SetToolTip(this.pictureBox5, "商品名称：兰蔻小黑瓶安瓶精华\n价格：690元\n品类：精华\n适用肤质：任何肤质\n功效：高活抗氧，修红修护\n产地：法国\n净含量：20ml\n保质期：36个月");
            toolTip6.SetToolTip(this.pictureBox6, "商品名称：兰蔻水份缘保湿舒缓乳液\n价格：520元\n品类：乳液\n适用肤质：干皮\n功效：卓效补水，锁水保湿，快速舒缓\n产地：法国\n净含量：50ml\n保质期：36个月");
            toolTip7.SetToolTip(this.pictureBox7, "商品名称：兰蔻菁纯精华乳液\n价格：2200元\n品类：乳液\n适用肤质：任何肤质\n功效：修护舒缓，三重驻颜体验，再现肌肤活力\n产地：法国\n净含量：75ml\n保质期：36个月");
            toolTip8.SetToolTip(this.pictureBox8, "商品名称：兰蔻净澈焕肤亮白乳液\n价格：760元\n品类：乳液\n适用肤质：油皮\n功效：改善粗糙，均匀肤色，美白提亮\n产地：法国\n净含量：75ml\n保质期：36个月");
            toolTip9.SetToolTip(this.pictureBox9, "商品名称：兰蔻水份缘保湿舒缓凝霜\n价格：595元\n品类：面霜\n适用肤质：任何肤质\n功效：双重水润肌密，柔滑由内而外，补水舒缓\n产地：法国\n净含量：50ml\n保质期：36个月");
            toolTip10.SetToolTip(this.pictureBox10, "商品名称：兰蔻菁纯臻颜乳霜\n价格：1380元\n品类：面霜\n适用肤质：任何肤质\n功效：饱满紧致，提亮淡纹，修护抗老\n产地：法国\n净含量：30ml\n保质期：36个月");
            
            /*string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=435";
            SqlCommand cmd= new SqlCommand(sql, conn);
            conn.Open();
            SqlDataReader rd=cmd.ExecuteReader();
            while (rd.Read())
            {
                toolTip1.SetToolTip(this.pictureBox1, "商品名称：" + rd[0].ToString() + "\n" + "价格：" +rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效："+rd[4].ToString() + "\n" + "产地："+rd[5].ToString() + "\n" +"净含量：" +rd[6].ToString() + "\n" +"保质期："+ rd[7].ToString()) ; ;
            }
            rd.Close();
            conn.Close();
            */
           
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=880";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox3_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=790";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox4_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=1080";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox5_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=690";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox6_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=520";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox7_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=2200";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox8_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=760";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox9_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=595";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void pictureBox10_Click(object sender, EventArgs e)
        {
            string sql = "select 商品名称,价格,品类,适用肤质 ,功效 ,产地 ,净含量 ,保质期 from 护肤 where 价格=1380";
            SqlCommand cmd = new SqlCommand(sql, conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            SqlDataReader rd = cmd.ExecuteReader();
            while (rd.Read())
            {
                MessageBox.Show("商品名称：" + rd[0].ToString() + "\n" + "价格：" + rd[1].ToString() + "元\n" + "品类：" + rd[2].ToString() + "\n" + "适用肤质：" + rd[3].ToString() + "\n" + "功效：" + rd[4].ToString() + "\n" + "产地：" + rd[5].ToString() + "\n" + "净含量：" + rd[6].ToString() + "\n" + "保质期：" + rd[7].ToString());
            }
            rd.Close();
            conn.Close();
        }

        private void uiButton3_Click(object sender, EventArgs e)
        {
            护肤_爽肤水 f = new 护肤_爽肤水();
            f.ShowDialog();
        }

        private void uiButton4_Click(object sender, EventArgs e)
        {
            护肤_乳液 f = new 护肤_乳液();
            f.ShowDialog();
        }

        private void uiButton5_Click(object sender, EventArgs e)
        {
            护肤_精华 f = new 护肤_精华();
            f.ShowDialog();
        }

        private void uiButton6_Click(object sender, EventArgs e)
        {
            护肤_面霜 f = new 护肤_面霜();
            f.ShowDialog();
        }

        private void uiButton7_Click(object sender, EventArgs e)
        {
            护肤_反馈 f = new 护肤_反馈();
            f.ShowDialog();
        }

        private void uiButton1_Click(object sender, EventArgs e)
        {
            护肤查看评价 f = new 护肤查看评价();
            f.ShowDialog();
        }

        private void uiButton2_Click(object sender, EventArgs e)
        {
            护肤推荐 f = new 护肤推荐();
            f.ShowDialog();
        }
    }
}
